package me.firstapp.service.bbs;

import java.util.Map;

import me.firstapp.common.utils.Page;
import me.firstapp.module.bbs.Reply;

public interface ReplyService {

	/**
	 * 回复新增
	 * 
	 * @param content
	 *            内容
	 * @param topicId
	 *            话题id
	 * @param fromMemberId
	 *            回复用户
	 * @param toMemberId
	 *            被回复用户
	 * @param apiClientId
	 *            api客户id
	 */
	Reply addReply(String content, Long topicId, Long fromMemberId, Long toMemberId, Long apiClientId);

	/**
	 * 查询话题回复数量
	 * 
	 * @param topicId
	 *            话题id
	 * @param apiClientId
	 *            api客户id
	 */
	Long findTopicReplyCounts(Long topicId, Long apiClientId);

	/**
	 * 分页 查询回复-简单版
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param topicId
	 * @param fromMemberId
	 * @param toMemberId
	 * @param apiClientId
	 * @return
	 */
	Page<Reply> findRepliesPageByTopicId(Integer pageNo, Integer pageSize, Long topicId, Long fromMemberId,
			Long toMemberId, Long apiClientId);

	/**
	 * 分页查询回复-通用版
	 * 
	 * @param topicId
	 * @param pageNo
	 * @param pageSize
	 * @param searchParams
	 * @param sortParam
	 * @param sortType
	 * @param apiClientId
	 * @return
	 */
	Page<Reply> findRepliesPageByParams(Long topicId, Integer pageNo, Integer pageSize,
			Map<String, Object> searchParams, String sortParam, String sortType, Long apiClientId);

	/**
	 * 删除
	 * 
	 * @param ids
	 *            多个id时用","隔开
	 */
	void deleteReplies(String ids, Long apiClientId);

	/**
	 * 通过id查询回复
	 * 
	 * @param id
	 * @param apiClientId
	 * @return
	 */
	Reply findReplyById(Long id, Long apiClientId);
}
